<template>
    <div class="header">我的后台管理系统 <span>{{ store1.getToken.username }},已登录</span>   <el-button @click="userExit()"  size="small" type="info">退出</el-button></div>
    <div class="aside_bar">
      <Menu></Menu>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>
</template>

<script setup lang='ts'>
import Menu from '@/components/menu/index.vue'
import {useUserStore} from '../pinia/user'
// import { useRouter } from 'vue-router';
const store1 = useUserStore()
// const router =useRouter()
const userExit = function(){
  store1.LOGIN_OUT()
  //如果直接跳转 还需清除 menuList 和permissonList ,不然会保留这次登录的数据。。或者location.reload()
  // router.push('/login')
  location.reload()
}

</script>
<style scoped>
.header{
    position:fixed;
    top:0;
    left:0;
    width: 100%;
    height: 50px;
    background: #1a1818;
    z-index:3;
    text-align: center;
    line-height: 50px;
    font-weight: 500;
    font-size: 22px;
    letter-spacing: 10px;
    color:#ada6a6;
  
}
.header span {
  position: absolute;
  /* top: 10px; */
  top:0;
  right:100px;
  font-size: 12px;
  font-weight: normal;
  letter-spacing: normal;
}
.header .el-button{
  position: absolute;
  top: 13px;
  right: 20px;
  background-color: #545c64;
}
.aside_bar{
    position:fixed;
    top:0;
    left:0;
    height: 100%;
    z-index:2 ;
    padding-top:50px;
    box-sizing: border-box;
}
.main{
    width: 100%;
    height: 100%;
    background-color: #e8d0f5;
    padding:70px 20px 20px 270px;
    box-sizing: border-box;
}
</style>